--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit fa7ce67eab38d58543ca53230ddf20427c40e8f1
Parents : ddb4ad0
Author : Mark Qvist <bc7291552be7a58f361522990465165c>
Date : 2026-05-21T14:06:15+02:00
Fixed guide focus handling
Changes
Diff
diff --git a/nomadnet/ui/textui/Guide.py b/nomadnet/ui/textui/Guide.py
index dfe3e12..b82245b 100644
--- a/nomadnet/ui/textui/Guide.py
+++ b/nomadnet/ui/textui/Guide.py
@@ -74,17 +74,17 @@ def _rows_above(attrmaps, index, cols):
class GuideColumns(urwid.Columns):
def keypress(self, size, key):
- if key == "up" and self.focus_position == 1:
- disp = getattr(self, "guide_display", None)
- if disp is not None:
- scrollable = getattr(disp, "_content_scrollable", None)
- if scrollable is not None:
- try:
- if scrollable.get_scrollpos() <= 0:
- nomadnet.NomadNetworkApp.get_shared_instance().ui.main_display.frame.focus_position = "header"
- return None
- except Exception:
- pass
+ # TODO: Scroll handling is currently very weird
+ # in the guide reader. When using page up/down
+ # or mouse scroll, the actual cursor position
+ # does not follow the scroll, as it does in the
+ # browser. If you scroll down, and then use the
+ # arrow keys, the position jumps back up to
+ # where you "left" the cursor.
+ # There's handling for this in the Browser code
+ # but I don't have time to port it over here at
+ # this point. If someone else takes that one up
+ # it's :) :) :)
return super().keypress(size, key)
@@ -98,7 +98,7 @@ class GuideLinkDelegate:
pass
def micron_released_focus(self):
- pass
+ self.reader.focus_topics()
def handle_link(self, target, fields=None):
if not target:
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────